﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HeresyManager
{
    [Serializable]
    public abstract class Trait
    {

        public abstract String Name { get; }

        public virtual IEnumerator<Comunication.Comunicator> Accire(Character c) { if (false) yield return null; }
        public virtual void DeAccire(Character c) { }

        public static bool operator !=(Trait first, Trait seccond)
        {
            return !first.Equals(seccond);
        }
        public static bool operator ==(Trait first, Trait seccond)
        {
            return first.Equals(seccond);
        }

        public override string ToString()
        {
            return Name;
        }

        // override object.Equals
        public override bool Equals(object obj)
        {
            //       
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237  
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }
            return true;
        }

        // override object.GetHashCode
        public override int GetHashCode()
        {
            int prime = 31;
            int result = 1;
            result = prime
                    * result
                    + this.GetType().GetHashCode();
            return result;
        }
    }
}
